/**
 * @description  : demo 示例
 * @descriptionDetail : 示例
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-12-05 16:15:51
 */
<template>
  <view>
    <me-table :load-data="loadData" :empty-click="emptyClick" ref="mescrollItem0">
      <!-- <view :class="'news-li li-' + d.index" slot-scope="d" @click="test">
        <view>{{ d.index }} - {{ d.data.title }}</view>
        <view class="new-content">
          {{ d.data.content }}
        </view>
      </view> -->
      <!-- <seal-comp :seal="d.data" slot-scope="d"></seal-comp> -->
    </me-table>
  </view>
</template>
<script>
import meTable from '@/components/me-table.vue'
import MescrollMoreMixin from "@/components/mescroll-uni/mixins/mescroll-more.js";
// import qrService from "@/service/storage/qr.service.js"
// import SealComp from '@/pages/storage/qr/SealComp.vue';

export default {
  components: { meTable, },
  mixins: [MescrollMoreMixin,],
  data() {
    return {}
  },
  created() {
    // qrService.caseList(1, 10, {}).then(dr => {
    //   console.log("二维码列表接口", dr);
    // });
  },
  methods: {
    // 调用后台接口查询数据：分页参数page.size, page.num
    loadData(page) {
      console.log("page.size", page.size, "page.num", page.num);
      return new Promise(resolve => {
        // TODO 模拟查询到的数据
        setTimeout(() => {
          let list = [];
          // 设置列表数据
          for (let k = 0; k < 10; k ++) {
            list.push({title: list.length + 1, content: "这是第" + (list.length + 1),});
          }
          resolve({"data": list,});
        }, 1000);
      });
    },
    // 列表没有查询到数据，可以加个按钮给予提示等额外操作（可选）
    emptyClick() {
      uni.showToast({title: '没有数据的点击按钮',})
    },
    // 指定页面滚动到指定位置（可选）
    handerScroll() {
      this.$refs['mescrollItem0'].scrollTo(".li-2", 2000);
      // 刷新列表
      this.$refs['mescrollItem0'].refresh();
    },
    test() {
      console.log("点击");
    },
  },
}
</script>
<style lang="scss" scope>
	/*展示上拉加载的数据列表*/
	.news-li{
		font-size: 32rpx;
		padding: 32rpx;
		border-bottom: 1rpx solid #eee;
	}
	.news-li .new-content{
		font-size: 28rpx;
		margin-top: 10rpx;
		margin-left: 20rpx;
		color: #666;
	}
</style>